#include "sneder.h"
#include "carrier.h"
#include <chrono>

sender::sender()
{

}

sender::~sender()
{
    
}

void sender::start_thread(int thread_count)
{
    t1 = thread(&sender::run, this, thread_count);
    cout << "sender thread id: " << t1.get_id() << endl;
    t1.detach();
}

void sender::run(int thread_count)
{
    carrier c1;
    c1.name = "carrier";
    c1.start_time = high_resolution_clock::now();
    for(int i = 0; i < thread_count; i++) {
        c1.id = i;
        c1.post();
    }
}